﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

public partial class ShopList : ExtBaseRpt
{
    string mid;
    protected void Page_Load(object sender, EventArgs e)
    {
        mid = Request.Params["mid"];
        if (!X.IsAjaxRequest)
        {
            BuildGridPanel(this.GridPanel1, mid, Session["UserID"].ToString());
            this.comShop.GetStore().DataSource = QueryShop("");
        }
    }
    protected void BtnQureyUser(object sender, DirectEventArgs e)
    {
        string str = StrSplitParam(comShop);
        str = str.Replace("''", "'");
        string sql = @"select * from v_shoplist "+((str =="")? "" :"where shopid in"+str);
        QueryData(this.Store1, mid, sql);
    }


    protected void RefreshDataSet(object sender, StoreReadDataEventArgs e)
    {
        BtnQureyUser(null,null);
    }
    protected void Store1_Submit(object sender, StoreSubmitDataEventArgs e)
    {
        //导出EXCEL
        ExtGridToExcel(mid,"xls",e.Xml,this.Response,this.Title);
    }
}